
'''
1.define
2.append
3.access
4.update
5.delete
6.iterate
7.find
8.lenth
9.sort
'''

def array():
    # create array
    a = []
    a.append(2)
    a.append(3)  # time complexity: O(1)
    a.insert(1, 99) # time complexity: O(N)
    temp = a[2]
    print(temp)
    a.remove(99)  # time complexity: O(N)
    a.pop(1) # time complexity: O(N)
    a.pop() # time complexity: O(1)

def iterate():
    arr = [3, 5, 12, 90]  # time complexity: O(1)
    # type 01
    for i in arr:
        print(i)
    # type 02
    for index, element in enumerate(arr):
        print("index:", index, "element:", element)
    # type 03
    for i in range(0, len(arr)):
        print("i:", i, "element:", arr[i])

def sort():
    arr = [3, 1, 2]
    arr.sort()  # time complexity: O(NlogN)
    arr.sort(reversed=True)


if __name__ == '__main__':
    array
    iterate